package com.hq.thread.test2;

/**
 * @ClassName MyObject
 * @Description TODO
 * @Author huangzl
 * @Date 2019/4/8 12:57
 * @Version 1.0
 **/
public class MyObject {

    synchronized public void method1(){
        System.out.println("==================>method1");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("=========================>method1 is end ");
    }

    synchronized public void method2(){
        System.out.println("==================>method2");
    }
}